package com.cow.config;


import com.alipay.api.request.AlipayTradePagePayRequest;

import com.cow.util.general.PropertiesUtil;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 *
 */
@Data
@Component
public class AlipayConfig {
    /**
     * 沙箱appId
     */
    public static final String APPID = "2021000148619088";

    /**
     * 请求网关  固定
     */
    public static final String URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    /**
     * 编码
     */
    public static final String CHARSET = "UTF-8";

    /**
     * 返回格式
     */
    public static final String FORMAT = "json";

    /**
     * RSA2
     */
    public static final String SIGNTYPE = "RSA2";

    /**
     * 异步通知地址
     */
    public static final String NOTIFY_URL = "http://" + PropertiesUtil.getDomain() + "/alipay/notify";

    /**
     * 同步地址
     */
    public static final String RETURN_URL = "http://" + PropertiesUtil.getDomain() + "/alipay" +
            "/success";

    /**
     * 应用私钥 pkcs8格式
     */
    public static final String RSA_PRIVATE_KEY =
            "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChss4C5RlUaicgkY+Lkt80A6C4aAnCk/G9nMS8oy3AmmKK4OKsZXfP7+n15W5vvABsB3cCailCPPdtMVI5ToVCEg3K/yHgOqVQU8SHF/nnJI0qxRkjeWJKht1zuj5yUmXpdrYbQhzgAuHALcK4BNaQQC8Doxhz5NXl0dBxE/w/E8WRjaktJwP03ydN7LLPGZIa693E54zl10p8cdj3IgePB1qZ6u2lGHdBrCi9Ma4Cl4TU2qt8mLVER/gHnxychwL2siqHSF4GOhIqkybBro+w42Wft5thztyTSM3gLt0f9yytlBL0KuPFJxOV9VbBhPLdDgIKovIlKvmTLBP9u8MxAgMBAAECggEBAIUCRQ4CkBxtGXRj6BUionHxzgICqoyhD8guLXMSM29sT0T4Cd1PtgeYzPYVXQuSNTKnzVByLTAsYEc0u/Mh0OHxYeEqjx4Yf6Wc0lth8JIe8fRNnwkcLyso1v78I6P8fZJWsSOo9YGbPUHNIpAmgqyz7zhpr5KdmQlr1q89hl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
     */
    public static final String ALIPAY_PUBLIC_KEY =
           "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAobLOAuUZVGonIJGPi5LfNAOguGgJwpPxvZzEvKMtwJpiiuDirGV3z+/p9eVub7wAbAd3AmopQjz3bTFSOU6FQhINyv8h4DqlUFPEhxf55ySNKsUZI3liSobdc7o+clJl6Xa2G0Ic4ALhwC3CuATWkEAvA6MYc+TV5dHQcRP8PxPFkY2pLScD9N8nTeyyzxmSGuvdxOeM5ddKfHHY9yIHjwdamertpRh3QawovTGuApeE1NqrfJi1REf4B58cnIcC9rIqh0heBjoSKpMmwa6PsONln7ebYc7ck0jN4C7dH/csrZQS9CrjxScTlfVWwYTy3Q4CCqLyJSr5kywT/bvDMQIDAQAB";
    private AlipayConfig() {
    }


    //多列模式的 aliPayRequest
    @Bean
    public AlipayTradePagePayRequest alipayTradePagePayRequest(){
        AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
        return alipayRequest;
    }
}
